<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::namespace('\App\Http\Controllers')->name('api')->group(function () {
    //小程序登录
    Route::any('/wechat/login', 'UserController@login');
});


Route::namespace('\App\Http\Controllers')->middleware(['token'])->name('api')->group(function () {
    //区县
    Route::get('/city', 'IndexController@city');
    //获取天气指数
    Route::get('/weather', 'WeatherController@index');
    //获取静态资源地址
    Route::get('/resources', 'IndexController@resources');
    //首页钓场列表
    Route::get('/fishing/site', 'FishingSiteController@site');
    //钓场详情
    Route::get('/fishing/details', 'FishingSiteController@details');
    //鱼情监控图历史
    Route::get('/fishing/monitor', 'FishingSiteController@monitorPhoto');
    //最新鱼情监控图
    Route::get('/fishing/new_monitor', 'FishingSiteController@newMonitorPhoto');
    //收藏与取消收藏
    Route::post('/fishing/bookmark', 'FishingSiteController@bookmark');
    //热门钓场
    Route::get('/fishing/hot', 'FishingSiteController@hot');
    //钓点地图
    Route::get('/fishing/site_map', 'FishingSiteController@siteMap');
    //搜索补全提示， select2
    Route::get('/fishing/search_hint', 'FishingSiteController@searchHint');
    //钓具店
    Route::get('/shop', 'ShopController@index');
    //钓鱼文章列表
    Route::get('/articles', 'ArticleController@index');
    //钓鱼文章详情
    Route::get('/article/details', 'ArticleController@details');
    //首页公告滚动
    Route::get('/announcement/newest', 'AnnouncementController@newest');
    //公告列表
    Route::get('/announcements', 'AnnouncementController@index');
    //公告详情
    Route::get('/announcement/details', 'AnnouncementController@details');
    //今日求签记录
    Route::get('/luck_tendency/record', 'LuckTendencyController@record');
    //求签
    Route::post('/luck_tendency/draw', 'LuckTendencyController@tendency');
    //提交直播链接
    Route::post('/live_room', 'LiveController@createRoom');
    //直播间列表
    Route::get('/live_room', 'LiveController@room');
    //所有直播间
    Route::get('/all_live_room', 'LiveController@allRoom');
    //我的直播间
    Route::get('/my_live_room', 'LiveController@myRoom');
    //关闭直播间
    Route::post('/close_live_room', 'LiveController@closeRoom');
    //头像、昵称修改
    Route::post('/user/info', 'UserController@setInfo');
    //获取用户信息
    Route::get('/user/info', 'UserController@info');
});

